<juci-layout-with-sidebar>
	<div ng-controller="wirelessSchedulePage">
		<juci-config-section>
			<juci-config-heading>{{ 'Schedule' | translate }}</juci-config-heading>
			<juci-config-info>{{ 'wifi.schedule.info' | translate }}</juci-config-info>
			<juci-config-lines>
				<juci-config-line title="{{'Schedule Function'|translate}}">
					<switch id="enabled" name="enabled" ng-model="status.schedule.value" class="green"></switch>
				</juci-config-line>
			</juci-config-lines>
		</juci-config-section>
		<juci-config-section ng-show="status.schedule.value">
			<juci-config-heading>{{ 'Setup Scheduling' | translate }}</juci-config-heading>
			<juci-config-lines>
				<juci-config-line title="{{'During this time the WiFi is'|translate}}">
					<juci-select ng-model="status.sched_status.value" ng-items="statusItems" placeholder="{{'Choose Schedule Mode'|translate}}"></juci-select>
				</juci-config-line>
			</juci-config-lines>
			<table class="table">
				<thead>
					<th translate>Day</th>
					<th translate>Time</th>
					<!--<th translate>Status</th>-->
					<th></th>
					<th></th>
				</thead>
				<tbody>
					<tr ng-repeat="item in schedules">
						<td>{{ item.days.value.join(",") }}</td>
						<td>{{ item.time.value }}</td>
						<!--<td>{{ item.enabled.value }}</td>-->
						<td style="width: 1%"><button class="btn btn-default" ng-click="onEditSchedule(item)"><i class="fa fa-pencil" style="{{editColor}}"></i></button></td>
						<td style="width: 1%"><button class="btn btn-default" ng-click="onDeleteSchedule(item)"><i class="fa fa-trash-o"></i></button></td>
					</tr>
					<tr>
						<td colspan="3"></td>
						<td style="width: 1%"><button class="btn btn-default" ng-click="onAddSchedule()"><i class="fa fa-plus"></i></button></td>
					</tr>
				</tbody>
			</table>
		</juci-config-section>
		<juci-config-apply></juci-config-apply>
		<modal title="Add a new WiFi Schedule" ng-show="schedule" on-accept="onAcceptSchedule()" 
			on-dismiss="onDismissSchedule()" dismiss-label="Cancel" accept-label="Save">
			<juci-schedule-edit ng-model="schedule"></juci-schedule-edit>
			<juci-errors ng-model="errors"/>
		</modal>
	</div>
</juci-layout-with-sidebar>
